<?php
include_once "inc/config.php";
include_once "inc/config_db.php";
include_once "inc/linb.php";
include_once "inc/template.php";
include_once "inc/class.page.php";
$id = verify_id( $_GET['id'] );
if (!isset($id) || empty($id)) {
	front_msg('缺少参数');
}
global $db,$webdir,$webhtmldir,$webmode;
$db->query("SELECT * FROM tun2_columns where id=".$_GET['id']."");
while($db->next_record())
{
	$module=$db->Record["module"];
	$templates=$db->Record["templates"];
	$turl=$db->Record["turl"];
}
if($module==99)
{
	Header("Location:$turl");
}else{
	if($templates=="")
	{
		if ($module==1)
		{
			$tid="single";
		}
		if ($module==2)
		{
			$tid="article";
		}
		if ($module==3)
		{
			$tid="product";
		}
		if ($module==4)
		{
			$tid="hr";
		}
		if ($module==5)
		{
			$tid="download";
		}
		if ($module==6)
		{
			$tid="book";
		}
	}
	else
	{
		$tid=$templates;
	}

	$location=Location('class',"$_GET[id]");
	define('IN' , true);
	$tpl_refresh_time = $skincache;
	$tpl_default_dir =  dirname(__FILE__)."/templates/".$skindir."";
	$t = new template;
	$t->tpl_default_dir = $tpl_default_dir;
	$t->tpl_refresh_time = $tpl_refresh_time;
	$strSql = "SELECT * FROM tun2_columns WHERE id ={$id}";
	$db->query( $strSql );
	if ( $db->next_record( ) )
	{
		$keywords     = $db->Record['keywords'];
		$description  = $db->Record['description'];
		$columnsname  = $db->Record['columnsname'];
		$content      = $db->Record['content'];
	}
	else
	{
		//echo "<script language=javascript>alert(\"对不起！没有您要找的栏目或是该栏目已经删除！\");window.location='".$webdir."index.php'</script>";
		//exit( );
		front_msg('对不起，没有您要找的栏目或是该栏目已经删除！',0,$webdir.'index.php');
	}
	$page=verify_id(@$_GET['PB_page']);
	$classid=verify_id($_GET['id']);
	$classname=namezh("tun2_columns","columnsname",verify_id($_GET['id']));
	include $t->tpl($tid);
}
?>